import service from "@/utils/request";

export const banner = () => {
  return service({
    method: "get",
    url: "/v1/banner",
  });
};
export const navbar = () => {
  return service({
    method: "get",
    url: "/v1/navbar",
  });
};

export const register = data => {
  return service({
    method: "post",
    url: "/v1/register",
    data,
  });
};

export const user = (data) => {
  return service({
    method: 'put',
    url: '/api/v1/rename',
    data
  })
}
// 获取宠物话题图片
export const getPetImg = () => {
  return service({
    method: "get",
    url: "/v1/getPetImg",
  });
};
// 获取宠物话题收藏表
export const getPet = params => {
  return service({
    method: "get",
    url: "/api/v1/getCollectionTopic",
    params,
  });
};
// 删除宠物话题收藏表
export const delPet = params => {
  return service({
    method: "delete",
    url: "/api/v1/removeCollectionTopic",
    params,
  });
};
// 修改用户头像收藏表
export const upuser = data => {
  return service({
    method: "post",
    url: "/api/v1/repic",
    data,
  });
};
// 获取宠物送样信息
export const getsend = params => {
  return service({
    method: "get",
    url: "/api/v1/getPetMessage",
    params,
  });
};
// 删除宠物送样信息
export const delsend = params => {
  return service({
    method: "delete",
    url: "/api/v1/removePet",
    params,
  });
};
// 根据uid查询用户信息
export const getMEssage = (params) => {
  return service({
    method: 'get',
    url: '/v1/checkinformation',
    params
  })
}
// 获取推荐收藏
export const getRecom = params => {
  return service({
    method: "get",
    url: "/api/v1/getCollectionRecommend",
    params,
  });
};
// 删除收藏话题
export const delRecom = params => {
  return service({
    method: "delete",
    url: "/api/v1/removeCollectionRecommend",
    params,
  });
};
// 获取智能穿戴收藏
export const getSmart = params => {
  return service({
    method: "get",
    url: "/api/v1/getCollectionClothe",
    params,
  });
};
// 删除智能穿戴收藏
export const delSmart = params => {
  return service({
    method: "delete",
    url: "/api/v1/removeCollectionClothe",
    params,
  });
};

// 根据uid获取购物车表中的数据
export const shopCart = params => {
  return service({
    method: 'get',
    url: '/api/v1/getShop',
    params
  })
}

// 更新购物车数量
export const shopAdd = data => {
  return service({
    method: 'put',
    url: '/api/v1/updateNum',
    data
  })
}
